<admintpl file="header"/>
<link rel="stylesheet" href="__PUBLIC__/css/jquery.datetimepicker.css">
<link rel="stylesheet" href="__PUBLIC__/css/main.css">
<link rel="stylesheet" href="__PUBLIC__/css/act_info.css">
<script src="__PUBLIC__/js/uploadify/jquery2.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/jquery.form.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/My97DatePicker/WdatePicker.js"></script>
<style type="text/css">
    .hidden {
        display: none;
    }
</style>
</head>
<body>
<div class="manage">
    <span><a href="{:U('Special/main')}">活动管理</a></span><span><a href="#">运营管理</a></span>
</div>

<div class="act_main"><a href="{:U('Special/main')}">活动管理</a>
        <span class="act-nav">
            <if condition="$list.TypeId eq 1">
                <a href="{:U('Special/main',array('Type'=>1))}">专题活动</a>
            </if>

        </span>
</div>
<div class="wrap">
    <div class="act_title">
        <div class="act_left">
            <span class="act_all" data-shopid="{$list.data.shop.ID}"><a href="#" class="rehref" style="color: #000">查看活动
                -
                {$list.data.shop.Name}</a></span>
        </div>
    </div>
    <div class="text-center act-view">
        <a href="#" data-toggle="modal" data-target="#JActivityeditact" data-editactid="{$list.data.shop.ID}">>
            <em>编辑活动信息</em></a>
        <a href="#" data-toggle="modal" data-target="#Jaddact" data-addactid="{$list.data.shop.ID}"> > <em>新增商家</em></a>
        <a href="#" data-toggle="modal" data-target="#JotherUrl" data-addactid="{$list.data.shop.ID}"> > <em>编辑推荐专题</em></a>

        <a href="#" data-toggle="modal" class="Jviewacturl" data-addactid="{$list.data.shop.ID}"> > <em>查看链接</em></a>
    </div>
    <table cellpadding="2" cellspacing="0" width="50%" align="center" class="table table-hover table-list Jtableview">
        <foreach name="list['data']['shop']['shopSite']" item="vo" key="k">
            <thead>
            <tr>
                <th>{$k}</th>
                <th> （<a href="{$vo.url}" target="_blank">{$vo.url}</a> . {$vo.total}个商家）</th>
                <th width="150px"></th>
                <th class="text-center"></th>
                <th></th>
            </tr>
            </thead>
            <tbody>
            <foreach name="vo" item="item" key="k2">
                <?php if(is_numeric($k2)){ ?>
                <tr>
                    <td>{$item.ShopName}</td>
                    <td></td>
                    <td><span class="view-list-up"></span></td>
                    <td class="editRes">
                        <a href="#" data-sort="{$item.Sort}" data-id="{$item.ID}" data-shopname="{$item.ShopName}"
                           data-toggle="modal" data-target="#Jbusinesseditact" class="Jsubedit">编辑</a>
                    </td>
                    <td class="delRes">
                        <a href="#" data-sort="{$item.Sort}" data-id="{$item.ID}" data-shopname="{$item.ShopName}"
                           data-toggle="modal" data-target="#Jbusinessdelact" class="Jsubdel">删除</a>
                    </td>
                </tr>
                <?php } ?>

            </foreach>

            <input type="hidden" data-city="{$k}" value="{$vo.url}" class="shop-url">


            </tbody>
        </foreach>
    </table>

    <div class="act-foot text-center" style="padding-top: 100px">
        <span>{$list.data.shop.UpdateTime}更新   {$list.data.shop.Type}   活动 id{$list.data.shop.IDNew}</span>
    </div>
</div>

<!--edit-->
<div class="modal fade" id="JActivityeditact" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     style="width: 500px; display: none;">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header" style="background-color: #ecf0f1">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myShopLabel" style="color: #000">编辑活动信息</h4>
            </div>
            <div class="modal-body">
                <div class="form-horizontal Jactadd">
                    <div class="control-group">
                        <label class="control-label">活动标题</label>

                        <div class="controls">
                            <input type="text" name="Name" class="activityName" placeholder="请添加话题标题" maxlength="20"
                                   value="{$list.data.shop.Name}">
                            <span class="form-required">*</span>
                        </div>
                    </div>
                    <div class="control-group editBusPic">
                        <label class="control-label">图片</label>

                        <div class="controls">
                            <img title="点击查看大图" id="title_img" style="cursor: pointer;" width="100" hight="100"
                                 src="http://img1.mwee.cn{$list.data.shop.Pic}"/>
                            <span class="form-required"></span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">上传图片</label>

                        <div class="controls">
                            <div id="coverImgInfo">
                                <form id="imgFormPic" action="{:U('Special/uploadshoppic')}" method="post"
                                      enctype="multipart/form-data">
                                    <input type="file" id="coverImg" name="coverImg" accept="image/*"
                                           onChange="coverActivityChange(this);">
                                    <span id="coverActImg"></span>
                                </form>
                                <input type="hidden" name="ShopPic" class="actshoppic" value="{$list.data.shop.Pic}">
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label ">预定信息显示</label>

                        <div class="controls">
                            <input type="radio" name="BookDate" value="1"
                            <if condition="$list['data']['shop']['BookDate'] eq 1">checked</if>
                            > 默认显示<br/><br/>
                            <input type="radio" name="BookDate" value="2"
                            <if condition="$list['data']['shop']['BookDate'] neq 1">checked</if>
                            > 指定日期
                            <input placeholder="选择指定日期" class="sureDate" type="text"
                                   onClick="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,minDate:now})"
                            <if condition="$list['data']['shop']['BookDate'] neq 1">
                                value="{$list['data']['shop']['BookDate']|date='Y-m-d',###}"
                            </if>
                            >
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label ">更多餐厅设置</label>

                        <div class="controls">
                            <select class="more-shop">
                                <option value="0"
                                <if condition="$list['data']['shop']['ViewMore'] eq 0">selected</if>
                                >请选择</option>
                                <option value="1"
                                <if condition="$list['data']['shop']['ViewMore'] eq 1">selected</if>
                                >跳转到排队预约列表</option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer" style="text-align: center">

                <button type="button" class="btn btn-danger JsaveActivity">保存</button>
            </div>
        </div>
    </div>
</div>


<!--add-->
<div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="Jaddact"
     class="modal small hide fade">
    <div class="modal-header" style="background-color: #ecf0f1">
        <button aria-hidden="true" data-dismiss="modal" class="close" type="button" id="closePushBtn"
                style="color: #000">×
        </button>
        <h4 id="myModalLabel" style="color: #000">添加商家</h4>
    </div>
    <div class="modal-body">
        <div class="control-group form-horizontal">
            <div class="control-group sort-back">
                <div class="controls text-center act-add-del Jshopinfo">
                    <span class="down-list">第 <input type="text" class="shop-sort" style="width: 50px" data-require="1"> 个显示</span>
                </div>
            </div>
            <div class="control-group Branch">
                <label class="control-label">商家分店：</label>

                <div class="controls">
                    <input type="text" name="ShopId" class="shopid JbusinessInfo" shopid="">
                    <span class="form-required">*</span>

                    <div class="Branchlist2">
                        <select multiple class="form-control Branchlist" style="height:200px">
                        </select>
                    </div>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">商家分店文案标题：</label>

                <div class="controls">
                    <input type="text" name="ShopTitle" class="shoptitle" placeholder="标题不超过20个字符" maxlength="20">
                    <span class="form-required">*</span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">商家分店文案详情：</label>

                <div class="controls">
                    <textarea name="ShopDesc" class="form-control shopdesc" rows="3" maxlength="400"
                              placeholder="不得超过400个字符"></textarea>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">标签：</label>

                <div class="controls">
                    <input name="ShopTag" class="form-control shopTag" data-require="1"><br/><span style="color:red">不要超过60个字符，添加格式英文逗号分隔 : 明星,包厢</span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">上传图片</label>

                <div class="controls">
                    <div id="coverBusinessImgInfo">
                        <form id="imgBussinessForm" action="{:U('Special/uploadshoppic')}" method="post"
                              enctype="multipart/form-data">
                            <input type="file" id="BusinesscoverImg" name="coverImg" accept="image/*"
                                   onChange="coverBusinessImgChange(this);">
                            <span id="coverShopImg"></span>
                        </form>
                        <input type="hidden" name="ShopPic" class="shoppic" id="shoppic">
                        <span class="form-required">*</span>
                    </div>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">显示业务类型：</label>

                <div class="controls">
                    <span><input type="radio" class="radioOne" name="shopfollow" value="1" disabled><i
                            class="shop-follow">排队取号</i></span>&nbsp;&nbsp;&nbsp;&nbsp;
                    <span><input type="radio" class="radioSix" name="shopfollow" value="6" disabled><i
                            class="shop-book">预约订座</i></span>
                </div>
            </div>
        </div>
    </div>
    <div class="modal-footer" style="text-align: center">

        <button class="btn btn-danger JsaveBusiness" type="button">保存</button>
    </div>
</div>

<!--other special url-->
<div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="JotherUrl"
     class="modal small hide fade">
    <div class="modal-header" style="background-color: #ecf0f1">
        <button aria-hidden="true" data-dismiss="modal" class="close" type="button" id=""
                style="color: #000">×
        </button>
        <h4 id="" style="color: #000">编辑推荐专题</h4>
    </div>
    <div class="modal-body">
        <div class="control-group form-horizontal Jshoplist">
            <foreach name="list['data']['shop']['link']" item="vo">
                <div class="control-group act-border" linkid="{$vo.ID}">
                    <div class="controls text-center  ">
                        <label class="Jshopdelete">
                            <span class="del-list" style="cursor: pointer">&nbsp;删除</span></label>
                    </div>
                    <div class="control-group">
                        <label class="control-label">大图</label>
                        <div class="controls">
                            <img title="点击查看大图" class="bigPic" style="cursor: pointer;" width="100" hight="100"
                                 src="http://img1.mwee.cn{$vo.BigPic}" bigPic="{$vo.BigPic}"/>
                            <span class="form-required"></span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">上传大图片</label>

                        <div class="controls">
                            <div class="coverBigImgInfo">
                                <form class="setBigLinkForm" action="{:U('Special/uploadBigImg')}" method="post"
                                      enctype="multipart/form-data">
                                    <input type="file" name="coverBigImg" accept="image/*"
                                           onChange="coverImgChangeBigLink(this,1);">
                                    <span class="coverbiglinkFormImg"><input type="hidden" class="bigPicInfo" value="{$vo.BigPic}"></span></form>
                                <span class="form-required">*</span>
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">小图</label>

                        <div class="controls">
                            <img title="点击查看大图" class="smallPic" style="cursor: pointer;" width="100" hight="100"
                                 src="http://img1.mwee.cn{$vo.SmallPic}" smallPic="{$vo.SmallPic}" />
                            <span class="form-required"></span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">上传小图片</label>

                        <div class="controls">
                            <div class="coverSmallImgInfo">
                                <form class="setSmallLinkForm" action="{:U('Special/uploadSmallImg')}" method="post"
                                      enctype="multipart/form-data">
                                    <input type="file" name="coverSmallImg" accept="image/*"
                                           onChange="coverImgChangeSmallLink(this,1);">
                                    <span class="coverSmalllinkFormImg"><input type="hidden" class="smallPicInfo" value="{$vo.SmallPic}"></span></form>
                                <span class="form-required">*</span>
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">专题活动链接：</label>

                        <div class="controls">
                            <input type="text" name="linkUrl" class="linkUrl" value="{$vo.Url}">
                        </div>
                    </div>
                </div>
            </foreach>
        </div>
        <if condition="count($list['data']['shop']['link']) elt 6">
            <button type="button" class="btn btn-info text-center JaddSpecialPushList">+添加专题</button>
        </if>
        <div class="modal-footer" style="text-align: center">
            <button class="btn btn-danger JsaveBusinessLink" type="button">保存</button>
        </div>
    </div>
</div>

<!-- editbusiness -->
<div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="Jbusinesseditact"
     class="modal small hide fade">
    <div class="modal-header" style="background-color: #ecf0f1">
        <button aria-hidden="true" data-dismiss="modal" class="close" type="button" id="closePushBtnInfo">×</button>
        <h4 id="myModalLabelInfo" class="getBusinessInfo" style="color: #000"></h4>
    </div>
    <div class="modal-body">
        <div class="control-group form-horizontal">
            <div class="control-group sort-back">
                <div class="controls text-center act-add-del Jshopinfo">
                        <span class="down-list">第 <input type="text" class="shopSortInfo" style="width: 50px"
                                                         data-require="1"> 个显示</span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">商家分店文案标题：</label>

                <div class="controls">
                    <input type="text" name="ShopTitle" class="Businesstitle" placeholder="标题不超过20个字符"
                           maxlength="20">
                    <span class="form-required">*</span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">商家分店文案详情：</label>

                <div class="controls">
                    <textarea name="ShopDesc" class="form-control Businessdesc" rows="3" maxlength="400"
                              placeholder="不得超过400个字符"></textarea>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">标签：</label>

                <div class="controls">
                    <input name="ShopTag" class="form-control shop-Tag" data-require="1" ><br/><span style="color:red">不要超过60个字符，添加格式英文逗号分隔 : 明星,包厢</span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">图片</label>

                <div class="controls Jmodifypic">
                    <span class="form-required"></span>
                </div>
            </div>

            <div class="control-group">
                <label class="control-label">上传图片</label>

                <div class="controls">
                    <div id="coverBusinessInfo">
                        <form id="imgBussiness" action="{:U('Special/uploadshoppic')}" method="post"
                              enctype="multipart/form-data">
                            <input type="file" id="Businesscover" name="coverImg" accept="image/*"
                                   onChange="coverEditBusinessImgChange(this);">
                            <span id="coverBunsiessImg"></span>
                        </form>
                        <input type="hidden" name="ShopPic" class="businessshoppic">
                    </div>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">显示业务类型：</label>
                <div class="controls">
                    <span><input type="radio" class="radioOne" name="shopfollow" value="1" disabled><i class="shop-follow">排队取号</i></span>&nbsp;&nbsp;&nbsp;&nbsp;
                    <span><input type="radio" class="radioSix" name="shopfollow" value="6" disabled><i class="shop-book">预约订座</i></span>
                    </div>
            </div>
        </div>
    </div>
    <div class="modal-footer" style="text-align: center">
        <button class="btn btn-danger JsaveEditBusiness  text-center" type="button">保存</button>
    </div>
</div>


<script type="text/javascript">
    var editActivityUrl = "{:U('Special/editActivityInfo')}";
    var getShopUrl = "{:U('Special/getShopInfo')}";
    var addBusinessUrl = "{:U('Special/addBusinessinfo')}";
    var editBusiness = "{:U('Special/editBusiness')}";
    var saveEditBusiness = "{:U('Special/saveEditBusiness')}";
    var saveSortBusiness = "{:U('Special/saveSortBusiness')}";
    var delBusiness = "{:U('Special/delBusiness')}";
    var getShopService = "{:U('Special/getShopService')}";
    var specialLink = "{:U('Special/addSpecialLink')}"
    var coverBigImg = "{:U('Special/uploadBigImg')}";
    var coverSmallImg = "{:U('Special/uploadSmallImg')}";
    $(function () {
        $('.rehref').click(function () {
            location.reload();
        })
    })
</script>

<script src="__PUBLIC__/js/common.js"></script>
<script src="__PUBLIC__/js/artDialog/artDialog.js"></script>
<script src="__PUBLIC__/js/act.js"></script>
<script src="__PUBLIC__/js/act_view.js"></script>
</body>
</html>